﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Workflow;
using Microsoft.SharePoint.Utilities;

namespace AgileShare.Framework.SiteProvisioning.Definitions
{
	public class ListInstanceDefinition : ListDefinitionBase
	{
		// Content Types
		// Fields
		// Folders
		// Forms 
		// Default Items

		// TODO: Event Receivers
		// TODO: Custom Actions
		// TODO: User Resources
		// TODO: Workflow Associations
		// TODO: Views

		/// <summary>
		/// Initializes a new instance of the <see cref="ListInstanceDefinition" /> class.
		/// </summary>
		public ListInstanceDefinition() : base() { }

		/// <summary>
		/// Initializes a new instance of the <see cref="ListInstanceDefinition" /> class.
		/// </summary>
		/// <param name="title">The title.</param>
		/// <param name="relativeUrl">The relative URL.</param>
		/// <param name="description">The description.</param>
		/// <param name="templateType">Type of the template.</param>
		/// <param name="contentTypeIds">The content type ids.</param>
		/// <param name="views">The views.</param>
		public ListInstanceDefinition(string title, string relativeUrl, string description, SPListTemplateType templateType, IEnumerable<SPContentTypeId> contentTypeIds, params ViewDefinition[] views)
		{			
			this.Title = title;
			this.Description = description;
			this.TemplateType = templateType;
			this.ViewDefinitions = views.ToList();
			this.ContentTypeIds = contentTypeIds.ToList();
			this.RelativeUrl = relativeUrl;
		}

		/// <summary>
		/// Gets or sets the title.
		/// </summary>
		/// <value>
		/// The title.
		/// </value>
		public string Title { get; set; }

		/// <summary>
		/// Gets or sets the name of the template.
		/// </summary>
		/// <value>
		/// The name of the template.
		/// </value>
		public string TemplateName { get; set; }

		/// <summary>
		/// Gets the relative URL. Set AppendListsPathToUrl to true if the 'Lists/' path should be appended to the UrlTitle.
		/// </summary>
		public string RelativeUrl { get; set; }


		// More properties

		//public bool? AllowEveryoneViewItems { get; set; }
		//public bool AllowMultiResponses { get; set; }
		//public SPBasePermissions AnonymousPermMask64 { get; set; }
		//public SPCalculationOptions CalculationOptions { get; set; }
		//public Guid DefaultContentApprovalWorkflowId { get; set; }
		//public string DefaultDisplayFormUrl { get; set; }
		//public string DefaultEditFormUrl { get; set; }
		//public DefaultItemOpen DefaultItemOpen { get; set; }
		//public bool DefaultItemOpenUseListSetting { get; set; }		
		//public string DefaultNewFormUrl { get; set; }
		//public string Direction { get; set; }
		//public bool DisableGridEditing { get; set; }
		//public DraftVisibilityType DraftVersionVisibility { get; set; }
		//public string EmailAlias { get; set; }
		//public bool EnableAssignToEmail { get; set; }
		//public bool EnableDeployWithDependentList { get; set; }
		//public bool EnableMinorVersions { get; set; }
		//public bool EnablePeopleSelector { get; set; }
		//public bool EnableResourceSelector { get; set; }
		//public bool EnableSchemaCaching { get; set; }
		//public bool EnableThrottling { get; set; }
		//public bool EnableVersioning { get; set; }
		//public bool EnforceDataValidation { get; set; }
		//public bool ExcludeFromOfflineClient { get; set; }
		//public bool ForceCheckout { get; set; }
		//public bool ForceDefaultContentType { get; set; }
		//public bool IrmEnabled { get; set; }
		//public bool IrmExpire { get; set; }
		//public bool IrmReject { get; set; }
		//public bool IsApplicationList { get; set; }
		//public bool IsSiteAssetsLibrary { get; set; }
		//public int MajorVersionLimit { get; set; }
		//public int MajorWithMinorVersionsLimit { get; set; }
		//public bool MultipleDataList { get; set; }
		//public bool NavigateForFormsPages { get; set; }
		//public bool NoCrawl { get; set; }
		//public bool Ordered { get; set; }
		//public int ReadSecurity { get; set; }
		//public bool RequestAccessEnabled { get; set; }
		//public bool RootWebOnly { get; set; }
		//public string SendToLocationName { get; set; }
		//public string SendToLocationUrl { get; set; }
		//public bool ShowUser { get; set; }
		//public SPAlertTemplate SmsAlertTemplate { get; set; }		
		//public virtual bool UseFormsForDisplay { get; set; }
		//public int WriteSecurity { get; set; }
	}
}
